<template>
  <div class="bg">
    <!-- <iframe id="child" :src="iframeSrc" style="width: 100%; height: 300%" @load="onIframeLoad"></iframe> -->
    <div @click="login()">111</div>
    <div @click="login1()">222</div>
  </div>
</template>

<script>
import { doLogin } from '@/api/getData'
export default {
  data() {
    return {
      iframeSrc: 'http://36.26.7.134:38080/photovoltaic-manager/index/portal.htm',
    }
  },
  //http://localhost:8080/#/previews
  mounted() {
    // 动态设置 cookie
    document.cookie = 'JSESSIONID=AF0ABF07BE64E7350D4DB35F3E3C31B6; path=/; domain=example.com; Secure; SameSite=None'
  },
  methods: {
    login() {
      let obj = {
        userId: 'uuu',
        password: 'uu6789',
      }
      doLogin(obj).then((res) => {
        console.log('res', res)
      })
    },
    getCookie(name) {
      const value = `; ${document.cookie}`
      // const parts = value.split(`; ${name}=`);
      // if (parts.length === 2) return parts.pop().split(';').shift();
    },
  },
}
</script>

<style lang="scss" scoped>
.bg {
  display: flex;
  height: 1200px;
}
</style>
